import React, { Component } from 'react'

export default class Event extends Component {
  constructor() {
    super()
    this.state = {
      num: 0
    }
    this.handleClick = this.handleClick.bind(this)
  }

// handleClick(n){
//   this.setState({
//     num: this.state.num + n
//   })
// }

// handleClick=()=>{
//   this.setState({
//     num: this.state.num + 1
//   })
// }

handleClick(){
  this.setState({
    num: this.state.num + 1
  })
}

  render() {
    return (
      <div>
        {
          this.state.num
        }
        <hr />
        {/* <button onClick={(event) => {
          console.log(event.target)
         this.handleClick(10);
        }
        }>change</button> */}
         {/* <button onClick={this.handleClick}>change</button> */}
         {/* <button onClick={this.handleClick.bind(this,10)}>change</button> */}
         <button onClick={this.handleClick}>change</button>

      </div>
    )
  }
}
